File: Alarm.txt Created: Mon Sep 09 00:25:29 1991 Description: Program documentation for TPW Application "Alarm" // STARTBLOCK File Version Information (REGENERATE) Regenerated: Mon Sep 09 00:25:29 1991 Skeleton by: Winpro/3, a product from Louis J. Cutrona, Jr. tpw.skl version 0.05 // ENDBLOCK A L A R M -- D O C U M E N T A T I O N Overview: Application files and their contents Alarm.pas - Main Pascal program file - tAlarm - application object - derived from TApplication - overrides InitInstance and InitMainWindow - tAlarmWindow - main window object - derived from TWindow - includes command-id-based methods for menu items and accelerator keys. AlarRC.pas - Pascal unit - const definitions for resource file identifiers AlarGbl.pas - Pascal unit - type definitions, vars, and initialization code for dialog data transfer buffers - code to preload and access strings from the string table resource AlarDlg.pas - Pascal unit - dialog objects derived from TDialog. - includes child-id-based methods for handling messages from each dialog control Alarm.rc - Resource definition file - definitions of application resources: dialogs, menus, icons, etc. AlarRC.h - C #defines for resource definition file - Required to compile resource definition file Alarm.rc and create Alarm.res using the rc.exe resource compiler. Alarm.txt - This documentation file A p p l i c a t i o n O b j e c t -- AlarmApplication The required application object (type tAlarm). Creates and displays the main window. Processes Windows messages. Handles termination. Defined in AlarmMain.pas. At the very end of that file, you will find the main block of the program, which defines AlarmApplication, initializes it, runs it, and finally destroys it. tAlarm.InitInstance does initialization that needs to be performed once for each execution (instance) of Alarm: Reads in any strings to be preloaded from the string table resource in Alarm.rc. Loads the application's default accelerator table resource (NULL). tAlarm.InitMainWindow constructs the window object that will serve as Alarm's main window. This method calls the main window's constructor, which eventually calls TWindowsObject.Register, which in turn calls tAlarmWindow.GetWindowClass which loads and sets the main window's icon (ALARM_ICON) resource and sets the main window's default menu (ALARM_MENU). A p p l i c a t i o n M a i n W i n d o w O b j e c t The main window object for Alarm is defined in the main program file AlarMain.pas and has the type name tAlarmWindow. Also defined there is a corresponding pointer type tpAlarmWindow. A pointer to the main window object is stored in the variable TApplication.MainWindow, which is inherited by tAlarm (and thus may also be referred to as tAlarm.MainWindow) M e n u I t e m s a n d A c c e l e r a t o r K e y s For each menu item defined in the resource definition file, there is a corresponding (command-message-based) method defined for the main window object type tAlarmWindow. The name of the method is created by appending "Method" to the symbolic identifer corresponding to the menu item or accelerator key in the resource definition file. Thus, the following menu and accelerator key command methods are defined: dlg_SetAlarmTimeMethod Action: Invokes modal dialog dlg_SetAlarmTime. idmALARMONMethod Action: none (displays message box). idmALARMOFFMethod Action: none (displays message box). dlg_AboutAlarmMethod Action: Invokes modal dialog dlg_AboutAlarm. STDCLOSEMethod Action: none (displays message box). idmHIDEMethod Action: none (displays message box). D i a l o g s The following dialog types, descended from TDialog, are defined in the unit AlarDlg (in file AlarDlg.pas). Within each type are control object pointers corresponding to each control in the dialog. These pointers are initialized in the dialog's constructor. The order of initialization is, and must be, the same as the order of declaration of the corresponding fields in the dialog's data transfer record type. Also in each type are child-id-based methods corresponding to each dialog control. By modifying these methods, you can customize each dialog's behavior. tdlg_SetAlarmTimeDialog - Transfer buffer var dlg_SetAlarmTimeTransferBuf (type rtdlg_SetAlarmTimeTransfer) - Child-id-based methods for individual controls - ET_MONTHMethod (Edit text) - ET_DAYMethod (Edit text) - ET_YEARMethod (Edit text) - ET_HOURMethod (Edit text) - ET_MINUTEMethod (Edit text) - EM_MESSAGEMethod (Edit text) tdlg_AboutAlarmDialog - Transfer buffer var dlg_AboutAlarmTransferBuf (type rtdlg_AboutAlarmTransfer) - Child-id-based methods for individual controls E N D O F F I L E Alarm.txt